home *** CD-ROM | disk | FTP | other *** search
- /* Load_Address
- A Macro by Steven. R. Giovenella, 5823 Dutchess Dr., Colorado Springs, CO 80918.
- © Copyright 1994 Steven. R. Giovenella, All rights reserved.
- This macro is my gift to the Amiga community. It may be given away free to any
- one, but it may NOT be sold in any way, shape, or form, not even for the cost of re
- production, downloading, shipping, or handling, without express written permission
- from the author listed above. Any person or company who violates the content of
- the previous sentence, agrees to pay Steven R. Giovenella $1,000 (US) for each copy
- of this macro sold. This macro may NOT be added to any disk which is to be sold for
- any price or fee, to include shipping and handling. The ONLY way this macro may
- be distributed is on a disk which is given away 100% free of all charges, or on via
- telecommunications networks which do not charge any additional fee as a result of a
- user downloading this particular macro. This macro may only be reproduced in its
- entirety, including all comment lines and code. The individual user may alter this
- macro for personal use, but may not then distribute the macro in any modified form.
- If you wish, feel free to send me some cash, a Christmas card, some other piece of
- software, or absolutely nothing as a gift for creating this macro. The author of this
- software is not responsible for any data loss or damage to computer equipment as a
- result, direct or indirect, of the use of this macro. */
-
- Options Results
-
- /* Determine insertion point */
- ShowMessage 1 0 '"Place cursor where you want " "the new address(es) in
- serted." "BEFORE BEGINNING THIS MACRO." " OK, Go on! " " Stop! "
- ""'
- IF Result = 2 THEN Exit
- type " "
- backspace
-
- /* Open the data file */
- RequestText '"Load Address" "Enter source Data File..."
- "Address_DataFile.ASCII"'
- datafile = Result
- file = "FWDocs/" || datafile
- Open file
- type " "
- backspace
-
- /* Address the data file */
- Status PortName
- port = Result
- portnumber = RIGHT(port,1) + 1
- newport = "FINALW." || portnumber
- ADDRESS VALUE newport
- Cursor UP
-
- BeginSearch:
-
- /* Get a string to search for */
- RequestText '"Load Address" "Enter search text" ""'
- Searchtext = Result
-
- /* Search for it */
- Cursor RIGHT
- MoveToLine 2 0
- m=0
- Find
- DO Forever
- Find searchtext
- Status LinePos
- coords = Result
- PARSE VAR coords BegLine BegPos EndLine EndPos
- IF EndPos~=0 THEN DO
- m = m+1
- CtrlUp
- ShiftUP
- AltDOWN
- Cursor UP
- AltUP
- ShiftDOWN
- AltDOWN
- Cursor DOWN
- extract
- match.m = Result
- AltUp
- CtrlUp
- ShiftUP
- END
- IF EndPos=0 THEN Leave
- END
-
- /* Reveal Matches */
- ShowMessage 1 0 '" 'm' match(es) found! " " " "" " Continue " " Start New
- Search " " Cancel "'
- IF Result = 2 THEN Call BeginSearch
- IF Result = 3 THEN DO
- Close FORCE
- Exit
- END
-
- /* Switch Arexx ports */
- ADDRESS VALUE port
- Cursor LEFT
- Cursor RIGHT
- WinToFront
-
- /* Load all addresses */
- DO i = 1 to m
- lastchar = ""
- comma = 0
- DO char = 1 to LENGTH(match.i)
- thischar = RIGHT(LEFT(match.i , char),1)
- IF thischar = "," THEN DO
- IF lastchar ~= "," THEN newparagraph
- comma = comma + 1
- IF comma=5 then DO
- backspace
- type ", "
- END
- IF comma=6 then DO
- backspace
- type " "
- END
- END
- IF thischar ~= "," THEN DO
- type thischar
- END
- lastchar = thischar
- END
- newparagraph
- newparagraph
- END
- /* Close Data File */
- ADDRESS VALUE newport
- Cursor LEFT
- Cursor RIGHT
- Close FORCE
-
-